package com.ae.shield.common.enchantment.shieldSuffix;

import net.minecraft.enchantment.Enchantment;

import javax.annotation.Nonnull;

public class TrickleCharge extends SuffixBase {
    public TrickleCharge() {
        super(new SuffixRate()
                .piles(8f, 0)
                .recovery(-0.3f, 1));
    }

    @Override
    public float levelRate(int level, SuffixProperty property, float rate) {
        switch (property) {
            case PILES:
                return level * rate;
            case RECOVERY:
                return rate + (level - 1f) * -0.1f;
            default:
                return rate;
        }
    }

    @Override
    protected boolean canApplyTogether(@Nonnull Enchantment enchantment) {
        return enchantment != SuffixList.SUPER_CHARGED.get() && super.canApplyTogether(enchantment);
    }
}
